﻿@model CustomerReportsModel
@{
    //page title
    ViewBag.Title = T("Admin.Customers.Reports").Text;
}
<div class="section-header">
    <div class="title">
        <img src="@Url.Content("~/Administration/Content/images/ico-customers.png")" alt="" />
        @T("Admin.Customers.Reports")
    </div>
    <div class="options">
    </div>
</div>

<div id="customer-reports">
    <ul>
        <li @Html.RenderSelectedTabIndex(0, GetSelectedTabIndex())>
            @T("Admin.Customers.Reports.BestBy.BestByOrderTotal")
        </li>
        <li @Html.RenderSelectedTabIndex(1, GetSelectedTabIndex())>
            @T("Admin.Customers.Reports.BestBy.BestByNumberOfOrders")
        </li>
        <li @Html.RenderSelectedTabIndex(2, GetSelectedTabIndex())>
            @T("Admin.Customers.Reports.RegisteredCustomers")
        </li>
    </ul>
    <div>
        @TabBestByOrderTotal()
    </div>
    <div>
        @TabBestByNumberOfOrders()
    </div>
    <div>
        @TabRegisteredCustomers()
    </div>
</div>
<script>
    $(document).ready(function () {
        $("#customer-reports").kendoTabStrip({
            animation: {
                open: {
                    effects: "fadeIn"
                }
            },
            select: tabstrip_on_tab_select
        });
    });
</script>

@{
    //custom tabs
    var eventMessage = new AdminTabStripCreated(this.Html, "customer-reports");
    EngineContext.Current.Resolve<IEventPublisher>().Publish(eventMessage);
    foreach (var eventBlock in eventMessage.BlocksToRender)
    {
        @eventBlock
    }
}


@helper TabBestByOrderTotal()
    {
        var dataDictAttributes = new ViewDataDictionary();
        dataDictAttributes.TemplateInfo.HtmlFieldPrefix = "bestbyordertotal";
    @Html.Partial("_ReportBestCustomersByOrderTotal", Model.BestCustomersByOrderTotal, dataDictAttributes)
}
@helper TabBestByNumberOfOrders()
    {
        var dataDictAttributes = new ViewDataDictionary();
        dataDictAttributes.TemplateInfo.HtmlFieldPrefix = "bestbynumberoforders";
    @Html.Partial("_ReportBestCustomersByNumberOfOrders", Model.BestCustomersByOrderTotal, dataDictAttributes)
}
@helper TabRegisteredCustomers()
    {
    @Html.Action("ReportRegisteredCustomers")
}